home *** CD-ROM | disk | FTP | other *** search
- Path: deimos.rz.uni-osnabrueck.de!lindi
- From: Klaus-Peter Lisson <dklisson>
- Newsgroups: comp.lang.c++
- Subject: HELP! 2 Classes, one name - how to resolve conflict?
- Date: 15 Jan 1996 09:15:52 GMT
- Organization: Universitaet Osnabrueck
- Message-ID: <4dd608$gcc@deimos.rz.uni-osnabrueck.de>
- NNTP-Posting-Host: rudra.informatik.uni-osnabrueck.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.01 9000/730)
- X-URL: news:comp.lang.c++
-
- Hi there,
-
- QUESTION:
- Can I compile a programm that includes and needs two classes
- that are NAMED THE SAME ???
-
-
- DETAILS:
- I'm using MSVC++ 2.1 with the MFC. In detail, I'm using
- the MFC-Collection-Classes (template versions) like CList,
- CMap etc.
-
- Now I want to include OO-Database-support with POET 3.0
- (an OODB-library), designed for use with the MSVC++.
-
- But, SLIGHT PROBLEM:
- #include <afxtempl.h> // for MFC-CList/CMap etc.
- #include <poet.h> // for OODB-support
- results in "class CList has already been defined"
-
- Internally, the OODB uses a self-defined class CList, which
- is exactly named the same as the MFC-Class.
- POET.h MFC (afxtmpl.h)
- class CList {..} class CList<...> {..}
-
- E-mailing the POET-support, i got a friendly reply but no real
- help: ".. this conflict in names will be fixed in the next
- release..." - no practicable workaround could be offered.
-
- So my question:
- Is there a chance in resolving such a naming conflict?
- I've some classes that use POET, some that use MFC, but none
- uses both at the same time...! Only my main-loop includes some
- of the POET-derived classes and some of "my" MFC-Classes.
- Particularly, I think of first compiling the classes that use POET
- then compiling my MFC-Classes and my "main"-programm, in the end
- linking all the obj-files.
- My hope is that in the obj-files, no names will be stored
- that could conflict with each other..?
-
- In short:
- Can I compile a programm that includes one class twice (in 2 versions)
- and if so, how..??
-
- And in general, (compiler experts adressed): When does a compiler
- "forget" about sourcecode-names and starts using memory adresses etc.?
-
- Any comments welcome.
-
- TIA,
-
-
-
- Klaus-Peter Lisson
- dklisson@kali.informatik.uni-osnabrueck.de
-
-